package demo.loop;

import java.util.Scanner;

/**
 * @Auther: hjy(lc))
 * @Date: 2022/7/20-07-20-15:10
 * @Description：demo.loop
 */
public class Switch_02 {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        System.out.println("请输入你要知道天数的年份以及月份：");
        int year = sc.nextInt();
        int month = sc.nextInt();
        int total_day = getDay(year,month);
        System.out.println(year + "/" + month + ":"+total_day);
    }

    private static int getDay(int year, int month) {
        int day = 30;
        switch (month){
            case 4:
            case 6:
            case 9:
            case 11:
                day = 31;
                break;
            case 2:
                if(If_01.isLeapYear(year))
                    day  = 29;
                else
                    day = 28;
                break;
        }
        return day;
    }
}
